<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>MiXiM: D:/Projects/MiXiM/extsrc/mixim/src/base/connectionManager/NicEntryDebug.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">MiXiM
   &#160;<span id="projectnumber">2.3</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('a00252.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">NicEntryDebug.h</div>  </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* -*- mode:c++ -*- ********************************************************</span>
<a name="l00002"></a>00002 <span class="comment"> * file:        NicEntryDebug.h</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * author:      Daniel Willkomm</span>
<a name="l00005"></a>00005 <span class="comment"> *</span>
<a name="l00006"></a>00006 <span class="comment"> * copyright:   (C) 2005 Telecommunication Networks Group (TKN) at</span>
<a name="l00007"></a>00007 <span class="comment"> *              Technische Universitaet Berlin, Germany.</span>
<a name="l00008"></a>00008 <span class="comment"> *</span>
<a name="l00009"></a>00009 <span class="comment"> *              This program is free software; you can redistribute it</span>
<a name="l00010"></a>00010 <span class="comment"> *              and/or modify it under the terms of the GNU General Public</span>
<a name="l00011"></a>00011 <span class="comment"> *              License as published by the Free Software Foundation; either</span>
<a name="l00012"></a>00012 <span class="comment"> *              version 2 of the License, or (at your option) any later</span>
<a name="l00013"></a>00013 <span class="comment"> *              version.</span>
<a name="l00014"></a>00014 <span class="comment"> *              For further information see file COPYING</span>
<a name="l00015"></a>00015 <span class="comment"> *              in the top level directory</span>
<a name="l00016"></a>00016 <span class="comment"> ***************************************************************************</span>
<a name="l00017"></a>00017 <span class="comment"> * part of:     framework implementation developed by tkn</span>
<a name="l00018"></a>00018 <span class="comment"> * description: Class to store information about a nic for the</span>
<a name="l00019"></a>00019 <span class="comment"> *              ConnectionManager module</span>
<a name="l00020"></a>00020 <span class="comment"> **************************************************************************/</span>
<a name="l00021"></a>00021 
<a name="l00022"></a>00022 <span class="preprocessor">#ifndef NICENTRYDEBUG_H</span>
<a name="l00023"></a>00023 <span class="preprocessor"></span><span class="preprocessor">#define NICENTRYDEBUG_H</span>
<a name="l00024"></a>00024 <span class="preprocessor"></span>
<a name="l00025"></a>00025 <span class="preprocessor">#include &quot;NicEntry.h&quot;</span>
<a name="l00026"></a>00026 
<a name="l00027"></a>00027 <span class="preprocessor">#include &lt;map&gt;</span>
<a name="l00028"></a>00028 <span class="preprocessor">#include &lt;vector&gt;</span>
<a name="l00029"></a>00029 
<a name="l00038"></a><a class="code" href="a00161.html">00038</a> <span class="keyword">class </span><a class="code" href="a00161.html" title="NicEntry is used by ConnectionManager to store the necessary information for each nic...">NicEntryDebug</a>: <span class="keyword">public</span> <a class="code" href="a00159.html" title="NicEntry is used by ConnectionManager to store the necessary information for each nic...">NicEntry</a>
<a name="l00039"></a>00039 {
<a name="l00040"></a>00040   <span class="keyword">protected</span>:
<a name="l00042"></a><a class="code" href="a00161.html#ac676487d56ac68916121ce8e52465205">00042</a>     <span class="keywordtype">int</span> <a class="code" href="a00161.html#ac676487d56ac68916121ce8e52465205" title="Number of in gates allocated for the nic so far.">inCnt</a>;
<a name="l00043"></a>00043 
<a name="l00045"></a><a class="code" href="a00161.html#af1bf7c23c872e6838f8111cf58e4839e">00045</a>     <span class="keywordtype">int</span> <a class="code" href="a00161.html#af1bf7c23c872e6838f8111cf58e4839e" title="Number of out gates allocated for the nic so far.">outCnt</a>;
<a name="l00046"></a>00046 
<a name="l00054"></a><a class="code" href="a00161.html#a2aa0dd90daecf5469bc9c8b53b21579c">00054</a>     <span class="keywordtype">bool</span> <a class="code" href="a00161.html#a2aa0dd90daecf5469bc9c8b53b21579c" title="Check for unknown free gates before next gate request.">checkFreeGates</a>;
<a name="l00055"></a>00055 
<a name="l00056"></a>00056     <span class="keyword">typedef</span> std::vector&lt;cGate* &gt; GateStack;
<a name="l00058"></a><a class="code" href="a00161.html#ae2e64139016744d1c8a59c4d9f6b009f">00058</a>     GateStack <a class="code" href="a00161.html#ae2e64139016744d1c8a59c4d9f6b009f" title="In Gates that were once used but are not connected now.">freeInGates</a>;
<a name="l00059"></a>00059 
<a name="l00061"></a><a class="code" href="a00161.html#a0564884c56d1bcda68b8797a5bd60af0">00061</a>     GateStack <a class="code" href="a00161.html#a0564884c56d1bcda68b8797a5bd60af0" title="Out Gates that were once used but are not connected now.">freeOutGates</a>;
<a name="l00062"></a>00062 
<a name="l00063"></a>00063   <span class="keyword">protected</span>:
<a name="l00070"></a>00070     cGate* <a class="code" href="a00161.html#aa028678e801ba669ad47a6588b2ad90a" title="Returns a free in gate of the nic.">requestInGate</a>(<span class="keywordtype">void</span>);
<a name="l00071"></a>00071 
<a name="l00078"></a>00078     cGate* <a class="code" href="a00161.html#ad601c375fa2fd737f88b3a475a06ff45" title="Returns a free out gate of the nic.">requestOutGate</a>(<span class="keywordtype">void</span>);
<a name="l00079"></a>00079 
<a name="l00090"></a>00090     <span class="keywordtype">int</span> <a class="code" href="a00161.html#ae4c6e480d8b2f3fc4199a7a8314ab2df" title="Collects all free gates with a certain pattern as names and puts them on a stack.">collectGates</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* pattern, GateStack&amp; gates);
<a name="l00091"></a>00091 
<a name="l00102"></a>00102     <span class="keywordtype">void</span> <a class="code" href="a00161.html#aac3b943e56b211541596a73f6437608a" title="Iterates over all existing gates of this NicEntries nic and host and checks wether they are useable b...">collectFreeGates</a>();
<a name="l00103"></a>00103 
<a name="l00104"></a>00104   <span class="keyword">public</span>:
<a name="l00108"></a><a class="code" href="a00161.html#a8a318f2611c8fcf9a495525a910f40b6">00108</a>     <a class="code" href="a00161.html#a8a318f2611c8fcf9a495525a910f40b6" title="Constructor, initializes all members.">NicEntryDebug</a>(<span class="keywordtype">bool</span> debug) :
<a name="l00109"></a>00109       <a class="code" href="a00159.html" title="NicEntry is used by ConnectionManager to store the necessary information for each nic...">NicEntry</a>(debug),
<a name="l00110"></a>00110       <a class="code" href="a00161.html#ac676487d56ac68916121ce8e52465205" title="Number of in gates allocated for the nic so far.">inCnt</a>(0),
<a name="l00111"></a>00111       <a class="code" href="a00161.html#af1bf7c23c872e6838f8111cf58e4839e" title="Number of out gates allocated for the nic so far.">outCnt</a>(0),
<a name="l00112"></a>00112       <a class="code" href="a00161.html#a2aa0dd90daecf5469bc9c8b53b21579c" title="Check for unknown free gates before next gate request.">checkFreeGates</a>(true),
<a name="l00113"></a>00113       <a class="code" href="a00161.html#ae2e64139016744d1c8a59c4d9f6b009f" title="In Gates that were once used but are not connected now.">freeInGates</a>(),
<a name="l00114"></a>00114       <a class="code" href="a00161.html#a0564884c56d1bcda68b8797a5bd60af0" title="Out Gates that were once used but are not connected now.">freeOutGates</a>()
<a name="l00115"></a>00115     {};
<a name="l00116"></a>00116 
<a name="l00120"></a><a class="code" href="a00161.html#a23514a51dfbdba46bf20b2f005a34214">00120</a>     <span class="keyword">virtual</span> <a class="code" href="a00161.html#a23514a51dfbdba46bf20b2f005a34214" title="Removes all dynamically created out-/ingates.">~NicEntryDebug</a>() {
<a name="l00121"></a>00121       <span class="keywordflow">while</span> (!<a class="code" href="a00159.html#a66b957327e66c042028f7b38e4bd0b46" title="Outgoing connections of this nic.">outConns</a>.empty()) {
<a name="l00122"></a>00122         <a class="code" href="a00159.html" title="NicEntry is used by ConnectionManager to store the necessary information for each nic...">NicEntry</a> *<span class="keyword">const</span> other = <span class="keyword">const_cast&lt;</span><a class="code" href="a00159.html" title="NicEntry is used by ConnectionManager to store the necessary information for each nic...">NicEntry</a>*<span class="keyword">&gt;</span>(<a class="code" href="a00159.html#a66b957327e66c042028f7b38e4bd0b46" title="Outgoing connections of this nic.">outConns</a>.begin()-&gt;first);
<a name="l00123"></a>00123         <span class="keywordflow">if</span> (other-&gt;<a class="code" href="a00159.html#a32f9544fbf045d921b0fb7f1c6f51f9a" title="Checks if this nic is connected to the &quot;other&quot; nic.">isConnected</a>(<span class="keyword">this</span>)) {
<a name="l00124"></a>00124           other-&gt;<a class="code" href="a00159.html#a0cce4edbe3eb6036ded986482de3de48" title="Disconnect two nics.">disconnectFrom</a>(<span class="keyword">this</span>);
<a name="l00125"></a>00125         }
<a name="l00126"></a>00126         <a class="code" href="a00161.html#a837ccd605ce3df345fcf3f5787673fac" title="Disconnect two nics.">disconnectFrom</a>(other);
<a name="l00127"></a>00127       }
<a name="l00128"></a>00128     }
<a name="l00129"></a>00129 
<a name="l00141"></a>00141     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a00161.html#af97ebc8c81c1f7d8094344d2f7fb6a17" title="Connect two nics.">connectTo</a>(<a class="code" href="a00159.html" title="NicEntry is used by ConnectionManager to store the necessary information for each nic...">NicEntry</a>* other);
<a name="l00142"></a>00142 
<a name="l00150"></a>00150     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a00161.html#a837ccd605ce3df345fcf3f5787673fac" title="Disconnect two nics.">disconnectFrom</a>(<a class="code" href="a00159.html" title="NicEntry is used by ConnectionManager to store the necessary information for each nic...">NicEntry</a>* other);
<a name="l00151"></a>00151 };
<a name="l00152"></a>00152 
<a name="l00153"></a>00153 <span class="preprocessor">#endif</span>
</pre></div></div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><b>NicEntryDebug.h</b>      </li>

    <li class="footer">Generated on Tue Mar 5 2013 21:26:29 for MiXiM by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>
